<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Sets the CUBRID database parameters</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.cubrid-set-autocommit.html">cubrid_set_autocommit</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.cubrid-set-drop.html">cubrid_set_drop</a></div>
 <div class="up"><a href="ref.cubrid.html">CUBRID 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.cubrid-set-db-parameter" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">cubrid_set_db_parameter</h1>
  <p class="verinfo">(PECL CUBRID &gt;= 8.4.0)</p><p class="refpurpose"><span class="refname">cubrid_set_db_parameter</span> &mdash; <span class="dc-title">Sets the CUBRID database parameters</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.cubrid-set-db-parameter-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><strong>cubrid_set_db_parameter</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$conn_identifier</code></span>  
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$param_type</code></span>  
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$param_value</code></span>  
   )</div>

  <p class="para rdfs-comment">
   The <span class="function"><strong>cubrid_set_db_parameter()</strong></span> function is used to set
   the CUBRID database parameters. It can set the following CUBRID database
   parameters:
  </p>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><strong><code>PARAM_ISOLATION_LEVEL</code></strong></li>
    <li class="member"><strong><code>PARAM_LOCK_TIMEOUT</code></strong></li>
   </ul>
  </p>

  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    The auto-commit mode can be set by using
    <span class="function"><a href="function.cubrid-set-autocommit.html" class="function">cubrid_set_autocommit()</a></span>.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.cubrid-set-db-parameter-parameters">
 <h3 class="title">参数</h3>
 <p class="para">
  <dl>

   
    <dt>
<em><code class="parameter">conn_identifier</code></em></dt>

     <dd>
<p class="para">
      The CUBRID connection. If the connection identifier is not specified,
      the last link opened by <span class="function"><a href="function.cubrid-connect.html" class="function">cubrid_connect()</a></span> is assumed.
     </p></dd>

   
   
    <dt>
<em><code class="parameter">param_type</code></em></dt>

    <dd>
<p class="para">Database parameter type.</p></dd>

   
   
    <dt>
<em><code class="parameter">param_value</code></em></dt>

    <dd>
<p class="para">Isolation level value (1-6) or lock timeout (in seconds) value.</p></dd>

   
  </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.cubrid-set-db-parameter-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   <strong><code>TRUE</code></strong> on success.
  </p>
  <p class="para">
   <strong><code>FALSE</code></strong> on failure.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.cubrid-set-db-parameter-examples">
  <h3 class="title">范例</h3>
  <div class="example" id="example-1034">
   <p><strong>Example #1 <span class="function"><a href="function.cubrid-get-db-parameter.html" class="function">cubrid_get_db_parameter()</a></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$conn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">cubrid_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">"localhost"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">33000</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"demodb"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"dba"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$params&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">cubrid_get_db_parameter</span><span style="color: #007700">(</span><span style="color: #0000BB">$conn</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$params</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">cubrid_set_autocommit</span><span style="color: #007700">(</span><span style="color: #0000BB">$conn</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">CUBRID_AUTOCOMMIT_TRUE</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">cubrid_set_db_parameter</span><span style="color: #007700">(</span><span style="color: #0000BB">$conn</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">CUBRID_PARAM_ISOLATION_LEVEL</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">2</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$params_new&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">cubrid_get_db_parameter</span><span style="color: #007700">(</span><span style="color: #0000BB">$conn</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$params_new</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">cubrid_disconnect</span><span style="color: #007700">(</span><span style="color: #0000BB">$conn</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
   </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
array(4) {
  [&quot;PARAM_ISOLATION_LEVEL&quot;]=&gt;
  int(3)
  [&quot;PARAM_LOCK_TIMEOUT&quot;]=&gt;
  int(-1)
  [&quot;PARAM_MAX_STRING_LENGTH&quot;]=&gt;
  int(1073741823)
  [&quot;PARAM_AUTO_COMMIT&quot;]=&gt;
  int(0)
}
array(4) {
  [&quot;PARAM_ISOLATION_LEVEL&quot;]=&gt;
  int(2)
  [&quot;PARAM_LOCK_TIMEOUT&quot;]=&gt;
  int(-1)
  [&quot;PARAM_MAX_STRING_LENGTH&quot;]=&gt;
  int(1073741823)
  [&quot;PARAM_AUTO_COMMIT&quot;]=&gt;
  int(1)
}
</pre></div>
    </div>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.cubrid-set-db-parameter-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.cubrid-get-db-parameter.html" class="function" rel="rdfs-seeAlso">cubrid_get_db_parameter()</a> - Returns the CUBRID database parameters</span></li>
    <li class="member"><span class="function"><a href="function.cubrid-set-autocommit.html" class="function" rel="rdfs-seeAlso">cubrid_set_autocommit()</a> - Set autocommit mode of the connection</span></li>
   </ul>
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.cubrid-set-autocommit.html">cubrid_set_autocommit</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.cubrid-set-drop.html">cubrid_set_drop</a></div>
 <div class="up"><a href="ref.cubrid.html">CUBRID 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
